<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateConfigTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('config', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('module', 50)->default('')->comment('模块名（优先按表名命名）');
            $table->string('field', 50)->nullable()->comment('字段');
            $table->string('field_name', 50)->default('')->comment('字段名称');
            $table->string('field_value', 2000)->default('')->comment('字段树值');
            $table->string('description')->default('')->comment('字段说明');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('config');
    }
}
